﻿
using System;

namespace Portal.Core.DAL
{
    /// <summary>
    /// The base class for <see cref="AnswerRow"/> that 
    /// represents a record in the <c>Answer</c> table.
    /// </summary>
    /// <remarks>
    /// Do not change this source code manually. Update the <see cref="AnswerRow"/>
    /// class if you need to add or change some functionality.
    /// </remarks>
    public abstract class AnswerRow_Base
    {
        private long _dap_ID;
        private long _hoi_ID;
        private bool _hoi_IDNull = true;
        private int _user_ID;
        private bool _user_IDNull = true;
        private string _dap_Content;
        private DateTime _ngay_Tao;
        private bool _ngay_TaoNull = true;
        private bool _isApproved;
        private bool _isApprovedNull = true;

        /// <summary>
        /// Initializes a new instance of the <see cref="AnswerRow_Base"/> class.
        /// </summary>
        public AnswerRow_Base()
        {
            // EMPTY
        }

        /// <summary>
        /// Gets or sets the <c>Dap_ID</c> column value.
        /// </summary>
        /// <value>The <c>Dap_ID</c> column value.</value>
        public long Dap_ID
        {
            get { return _dap_ID; }
            set { _dap_ID = value; }
        }

        /// <summary>
        /// Gets or sets the <c>Hoi_ID</c> column value.
        /// This column is nullable.
        /// </summary>
        /// <value>The <c>Hoi_ID</c> column value.</value>
        public long Hoi_ID
        {
            get
            {
                if (IsHoi_IDNull)
                    throw new InvalidOperationException("Cannot get value because it is DBNull.");
                return _hoi_ID;
            }
            set
            {
                _hoi_IDNull = false;
                _hoi_ID = value;
            }
        }

        /// <summary>
        /// Indicates whether the <see cref="Hoi_ID"/>
        /// property value is null.
        /// </summary>
        /// <value>true if the property value is null, otherwise false.</value>
        public bool IsHoi_IDNull
        {
            get { return _hoi_IDNull; }
            set { _hoi_IDNull = value; }
        }

        /// <summary>
        /// Gets or sets the <c>User_ID</c> column value.
        /// This column is nullable.
        /// </summary>
        /// <value>The <c>User_ID</c> column value.</value>
        public int User_ID
        {
            get
            {
                if (IsUser_IDNull)
                    throw new InvalidOperationException("Cannot get value because it is DBNull.");
                return _user_ID;
            }
            set
            {
                _user_IDNull = false;
                _user_ID = value;
            }
        }

        /// <summary>
        /// Indicates whether the <see cref="User_ID"/>
        /// property value is null.
        /// </summary>
        /// <value>true if the property value is null, otherwise false.</value>
        public bool IsUser_IDNull
        {
            get { return _user_IDNull; }
            set { _user_IDNull = value; }
        }

        /// <summary>
        /// Gets or sets the <c>Dap_Content</c> column value.
        /// This column is nullable.
        /// </summary>
        /// <value>The <c>Dap_Content</c> column value.</value>
        public string Dap_Content
        {
            get { return _dap_Content; }
            set { _dap_Content = value; }
        }

        /// <summary>
        /// Gets or sets the <c>Ngay_Tao</c> column value.
        /// This column is nullable.
        /// </summary>
        /// <value>The <c>Ngay_Tao</c> column value.</value>
        public DateTime Ngay_Tao
        {
            get
            {
                if (IsNgay_TaoNull)
                    throw new InvalidOperationException("Cannot get value because it is DBNull.");
                return _ngay_Tao;
            }
            set
            {
                _ngay_TaoNull = false;
                _ngay_Tao = value;
            }
        }

        /// <summary>
        /// Indicates whether the <see cref="Ngay_Tao"/>
        /// property value is null.
        /// </summary>
        /// <value>true if the property value is null, otherwise false.</value>
        public bool IsNgay_TaoNull
        {
            get { return _ngay_TaoNull; }
            set { _ngay_TaoNull = value; }
        }

        /// <summary>
        /// Gets or sets the <c>IsApproved</c> column value.
        /// This column is nullable.
        /// </summary>
        /// <value>The <c>IsApproved</c> column value.</value>
        public bool IsApproved
        {
            get
            {
                if (IsIsApprovedNull)
                    throw new InvalidOperationException("Cannot get value because it is DBNull.");
                return _isApproved;
            }
            set
            {
                _isApprovedNull = false;
                _isApproved = value;
            }
        }

        /// <summary>
        /// Indicates whether the <see cref="IsApproved"/>
        /// property value is null.
        /// </summary>
        /// <value>true if the property value is null, otherwise false.</value>
        public bool IsIsApprovedNull
        {
            get { return _isApprovedNull; }
            set { _isApprovedNull = value; }
        }

        /// <summary>
        /// Returns the string representation of this instance.
        /// </summary>
        /// <returns>The string representation of this instance.</returns>
        public override string ToString()
        {
            System.Text.StringBuilder dynStr = new System.Text.StringBuilder(GetType().Name);
            dynStr.Append(':');
            dynStr.Append("  Dap_ID=");
            dynStr.Append(Dap_ID);
            dynStr.Append("  Hoi_ID=");
            dynStr.Append(IsHoi_IDNull ? (object)"<NULL>" : Hoi_ID);
            dynStr.Append("  User_ID=");
            dynStr.Append(IsUser_IDNull ? (object)"<NULL>" : User_ID);
            dynStr.Append("  Dap_Content=");
            dynStr.Append(Dap_Content);
            dynStr.Append("  Ngay_Tao=");
            dynStr.Append(IsNgay_TaoNull ? (object)"<NULL>" : Ngay_Tao);
            dynStr.Append("  IsApproved=");
            dynStr.Append(IsIsApprovedNull ? (object)"<NULL>" : IsApproved);
            return dynStr.ToString();
        }
    } // End of AnswerRow_Base class
} // End of namespace


